//
//  HTComposeButton.swift
//  weibo
//
//  Created by JonsonLiu on 16/4/25.
//  Copyright © 2016年 liujonson. All rights reserved.
//

import UIKit

class HTComposeButton: UIButton {

    override var highlighted: Bool {
        get{
            return false
        }
        set{
            
        }
    }

    

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    
    private func setupUI(){
    
        titleLabel?.textAlignment = .Center
        imageView?.contentMode = .Center
    }
    
    
     override func layoutSubviews() {
        super.layoutSubviews()
        
        self.imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width)
        self.titleLabel?.frame = CGRect(x: 0, y: self.frame.width, width: self.frame.width, height: self.frame.height - self.frame.width)
    }
    
}
